package com.sat.user.controller;

import com.sat.user.pojo.Address;
import com.sat.user.service.AddressService;
import entity.Result;
import entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/address")
public class AddressController {

    @Autowired
    private AddressService addressService;

    @RequestMapping("findAddress/{addressid}")
    public Result<Address> findAddress(@PathVariable Integer addressid){

        Address address = addressService.findAddressById(addressid);
        return new Result<Address>(false, StatusCode.LOGINERROR,"查找地址成功",address);
    }
}
